﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Kovan.DAL.UserCenter;
using Kovan.Model.Entity.UserCenter;

namespace Kovan.BLL.UserCenter
{
    public class BActUserRole
    {
        DActUserRole dal = new DActUserRole();

        #region 当前类的实例
        private static readonly BActUserRole Instances = new BActUserRole();

        private BActUserRole() { }

        public static BActUserRole GetInstances()
        {
            return Instances;
        }
        #endregion

        /// <summary>
        /// 获取集合（根据用户ID）
        /// </summary>
        /// <param name="userid"></param>
        /// <returns></returns>
        public IEnumerable<act_user_role> GetList(long? userid)
        {
            return dal.GetList(userid);
        }

        /// <summary>
        /// 获取实体
        /// </summary>
        /// <param name="id">主键ID</param>
        /// <returns></returns>
        public act_user_role GetModel(int id)
        {
            return dal.GetModel(id);
        }

        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="model">实体</param>
        /// <returns></returns>
        public int Add(act_user_role model)
        {
            return dal.Add(model);
        }

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id">主键ID</param>
        /// <returns></returns>
        public int Delete(int id)
        {
            return dal.Delete(id);
        }

        /// <summary>
        /// 删除记录（根据用户ID）
        /// </summary>
        /// <param name="userid"></param>
        /// <returns></returns>
        public int DeleteByUserID(long userid)
        {
            return dal.DeleteByUserID(userid);
        }

        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="model">实体</param>
        /// <returns></returns>
        public int Update(act_user_role model)
        {
            return dal.Update(model);
        }
    }
}
